package com.copm.ifm.servers.sys.client;

import com.copm.ifm.base.api.pojo.PageDTO;
import com.copm.ifm.base.api.pojo.PageVO;
import com.copm.ifm.base.basic.ServiceResponse;
import com.copm.ifm.servers.sys.dto.SysRoleDTO;
import com.copm.ifm.servers.sys.entity.SysRole;
import com.copm.ifm.servers.sys.vo.SysRoleVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 系统角色开放接口声明类
 *
 * @author tp
 * @date 2020/12/17 14:47
 */
@FeignClient(value = "sys", contextId = "sysRoleClient")
@RequestMapping("/sys-role")
public interface SysRoleClient {

    @ApiOperation("条件查询-分页")
    @PostMapping("/page")
    ServiceResponse<PageVO<SysRoleVO>> page(@RequestBody PageDTO<SysRoleDTO> param);

    @ApiOperation("条件查询-不分页")
    @PostMapping("/list")
    ServiceResponse<List<SysRoleVO>> list(@RequestBody SysRoleDTO queryDTO);

    @GetMapping("/by/id")
    ServiceResponse<SysRoleVO> getById(@RequestParam Long id);

    @PostMapping
    ServiceResponse<SysRole> save(@RequestBody SysRole entity);
}
